<template>
	<view class="container">
		<logistics :wlInfo="wlInfo" :addr="addr" v-if="wlInfo"></logistics>
		<view class="none" v-else>
			暂无物流信息
		</view>
	</view>
</template>

<script>
	import {
		mapMutations,
		mapState,
		mapGetters
	} from 'vuex'
	import logistics from '@/subpkg/xinyu-logistics/xinyu-logistics.vue'
	export default {

		components: {
			logistics
		},
		data() {
			return {
				wlInfo: {},
				addr:'',
				phone:''
			};
		},
		onLoad(option) {
			// console.log(option.addr)
			this.addr=option.addr
			this.phone=uni.getStorageSync('phone')
			this.getWuLiu(option.expNum)
		},
		methods: {
			// 获取物流信息
			async getWuLiu(num) {
				console.log(11)
				const {
					data: res
				} = await uni.$http.post('/order/getWuLiu', {
					phone: this.phone, // 手机号
					number: num, // 物流单号
					userId:this.userInfo._id
				})
				console.log('3344')
				this.wlInfo = res.result
			}

		},
		computed: {
			...mapState('m_user', ['userInfo']),
		}
	}
</script>

<style lang="scss">
	.none{
		padding-left: 24rpx;
		color: #666;
	}
	.list {
		padding: 0 24px;
		padding-top: 60rpx;

		.item {
			display: flex;
			margin-bottom: 50rpx;

			.time {
				width: 70rpx;
				font-size: 22rpx;
				font-weight: 400;
				color: #999999;
				line-height: 36rpx;

				.month_day,
				.hour_minute {
					width: 70rpx;
				}
			}

			.status {
				font-size: 28rpx;
				font-weight: 400;
				color: #999999;
			}
		}
	}

	.company_order_num {
		height: 195rpx;
		border-top: 1rpx solid #DCDCDC;
		padding: 0 25rpx;
		box-sizing: border-box;
		display: flex;
		align-items: center;
	}

	.gap {
		width: 100%;
		height: 16rpx;
		background: #F4F4F4;
	}

	.car {
		width: 100rpx;
		height: 100rpx;
	}

	.order_num {
		margin-left: 50rpx;

		.company {
			font-size: 32rpx;
			font-weight: 500;
			color: #333333;
		}

		.num {
			font-size: 24rpx;
			font-weight: 500;
			color: #333333;
			margin-top: 12rpx;
		}
	}
</style>
